﻿using UnityEngine;

public class ButterflyInput
{
    private ButterflyMovement butterfly;

    public ButterflyInput(ButterflyMovement _butterfly)
    {
        butterfly = _butterfly;
    }

    public void update()
    {
        if (isLeftMouseButtonPressed())
            upButterfly();

        if (isLeftMouseButtonReleased())
            downButterfly();
    }

    private bool isLeftMouseButtonPressed()
    {
        return Input.GetMouseButtonDown(0);
    }

    private bool isLeftMouseButtonReleased()
    {
        return Input.GetMouseButtonUp(0);
    }

    private void upButterfly()
    {
        butterfly.up();
    }

    private void downButterfly()
    {
        butterfly.down();
    }
}
